<%--
  Created by IntelliJ IDEA.
  User: MGL
  Date: 2020/12/8
  Time: 13:58
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登录界面</title>
    <link href="../css/H-ui.min.css" rel="stylesheet" type="text/css" />
    <link href="../css/H-ui.login.css" rel="stylesheet" type="text/css" />
    <link href="../css/style.css" rel="stylesheet" type="text/css" />
    <link href="../lib/Hui-iconfont/1.0.8/iconfont.css" rel="stylesheet" type="text/css" />
</head>
<body>
<input type="hidden" id="TenantId" name="TenantId" value="" />
<div class="header"></div>
<div class="loginWraper">
    <div class="loginBox">
        <form id="login-form" class="form form-horizontal" action="" method="post">
            <div class="row cl">
                <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60d;</i></label>
                <div class="formControls col-xs-8">
                    <input value="admin1" id="username" name="username" type="text" placeholder="账户" class="input-text size-L">
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60e;</i></label>
                <div class="formControls col-xs-8">
                    <input value="123" id="password" name="password" type="password" placeholder="密码" class="input-text size-L">
                </div>
            </div>
            <div class="row cl">
            </div>
            <div class="row cl">
                <div class="formControls col-xs-8 col-xs-offset-3">
                    <button type="submit" class="btn btn-success radius size-L">&nbsp;登&nbsp;&nbsp;&nbsp;&nbsp;录&nbsp;</button>
                    <button type="reset" class="btn btn-default radius size-L">&nbsp;取&nbsp;&nbsp;&nbsp;&nbsp;消&nbsp;</button>
                </div>
            </div>
        </form>
    </div>
</div>
<div class="footer">权限管理系统</div>
<script type="text/javascript" src="../lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="../js/H-ui.min.js"></script>
<script type="text/javascript" src="../lib/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="../lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script>

    <%--$(function () {--%>

    <%--    $("#login-form").--%>

    <%--    $("#login-form").validate({--%>
    <%--        callback:function (from) {--%>
    <%--            $.post("${pageContext.request.contextPath}/userContreller/loginContreller",form,function (data) {--%>
    <%--                alert(data)--%>
    <%--            })--%>
    <%--            return false;--%>
    <%--        }--%>
    <%--    })--%>
    <%--})--%>



    $('#login-form').validate({

        submitHandler:function(form){
            $.ajax({
                type: 'post',
                url: "${pageContext.request.contextPath}/userContreller/loginContreller",
                data:{
                    username:$('#username').val(),
                    password:$('#password').val()
                },
                success:function (date) {
                    if (date=="user_success"){
                        alert("登录成功")
                        location.href="toIndex";
                    }else {
                        alert("用户或密码错误")
                    }
                }
            });

            return false;
        }
    });


</script>
</body>
</html>
